package com.hd.sup.modules.district.model;

import java.io.Serializable;

import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.extension.activerecord.Model;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.NoArgsConstructor;

import java.io.Serializable;

/**
 * <p>
 * 省市区基础信息
 * </p>
 *
 * @author chentl123
 * @since 2020-12-28
 */
@NoArgsConstructor
@AllArgsConstructor
@EqualsAndHashCode(callSuper = true)
@Data
@TableName("sp_region")
public class Region extends Model<Region> {

    private static final long serialVersionUID = 1L;

    //行政区划列表查询构造
    public Region(String name, Integer pid) {
        this.name = name;
        this.pid = pid;
    }

    /**
     * 区域id
     */
    private Integer id;
    /**
     * 区域名称
     */
    private String name;
    /**
     * 区域编码
     */
    private String code;
    /**
     * 父id
     */
    private Integer pid;
    /**
     * 经度
     */
    private Double lng;
    /**
     * 纬度
     */
    private Double lat;
    /**
     * 组织机构id
     */
    @TableField("dept_id")
    private String deptId;

    @Override
    protected Serializable pkVal() {
        return this.id;
    }


}
